package bavaria.hightec.banking;

import java.util.HashMap;
import java.util.Map;

public class BankRegistry {
	
	private static BankRegistry bankRegistryInstance;
	private static Map<String,B2B> bankreg;
	
	private BankRegistry(){
		bankreg = new HashMap<String,B2B>();
	}
	
	
	public static BankRegistry getInstance(){
		if(bankRegistryInstance==null){
			bankRegistryInstance = new BankRegistry();
		}
		return bankRegistryInstance;
	}
	
	public void bind(String name, B2B bank){
		bankreg.put(name, bank);
	}
	
	public B2B lookup(String name){
		return bankreg.get(name);
	}

}
